import { HttpClient } from '@angular/common/http';
import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { AppState } from '@app/core/core.state';
import { CustomerConfigService } from '@app/core/public-api';
import { Store } from '@ngrx/store';

@Component({
  selector: 'tb-show-images-dialog',
  templateUrl: './show-images-dialog.component.html',
  styleUrls: ['./show-images-dialog.component.scss']
})
export class ShowImagesDialogComponent implements OnInit {


  constructor(private http: HttpClient, private store: Store<AppState>,
    @Inject(MAT_DIALOG_DATA) public data: {url:string,deviceName:string},
    private customerconfigService: CustomerConfigService) {
  }

  imgsList:any[];
  ngOnInit(): void {

    this.http.post('/api/flv/http_url', { params: { url:this.data.url,deviceName:this.data.deviceName } }).subscribe(e=>{
      const response = e as any;
      this.imgsList = Object.values(response);
      console.log("response",response)
    })

  }

}
